<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><s:if test="site.siteId==null"><s:text name="site.add.title"/></s:if><s:else><s:text name="site.edit.title"/></s:else></title>
	<%@ include file="/common/meta.jsp"%>
	<%@ include file="/common/common.jsp"%>
</head>
<body>
<div id="wrapper">
	<div class="curmb"><s:text name="your.site.position"/>:<a href="${ctx}/main.action"><s:text name="homepage"/></a><span>></span><s:text name="site.title"/></div>
	<div class="listtit"><p><span><strong><s:if test="site.siteId==null"><s:text name="site.add.title"/></s:if><s:else><s:text name="site.edit.title"/></s:else></strong></span></p></div>
	<div class="listadd">
		<s:hidden name="site.siteName" id="sitename"/>
		<s:hidden name="site.siteShortName" id="siteShortName"/>
		<s:form action="site-save" id="saveForm">
		<s:hidden name="site.siteId" id="siteId"/>
		<s:hidden name="picTemp" id="pic1"/>
		<s:hidden name="siteLogoDbPath"></s:hidden>
		<s:hidden name="siteBannerDbPath"></s:hidden>
		<div class="listoperate" id="listoperate">
		    <span class="space20"></span>
			     <a href="#" id="basic" class="alinkscurrent"><s:text name="基本信息"/></a>|
			     <a href="#" id="attachConfig" class="alinks"><s:text name="附件配置" /> </a>|
			      <a href="#" id="otherInfo" class="alinks"><s:text name="其他信息" /> </a>
		</div>
		<table class="addgrid" id="bs">
		<s:if test="site.siteId != null">
			<tr>
				<th>&nbsp;</th>
				<td colspan="3">
				
					<s:if test="%{authLicence('2_2_1',site.siteId) || authLicence('1_1_5')}">
						<input type="button" value="<s:text name="save"/>" class="btnlist2" id="save_button" name="save_button"/>
					</s:if> 
					<s:else>
						<s:submit disabled="true" value="%{getText('save')}" cssClass="btnlist2"/>
					</s:else>
					<s:if test="%{authLicence('2_2_1',site.siteId)}">
						<input type="button" value="<s:text name="delete"/>" class="btnlist2" id="top_del_btn" />
					</s:if>
					<s:else>
						<input type="button" disabled="disabled" value="<s:text name="delete"/>" class="btnlist2" id="top_del_btn" />
					</s:else>
					<s:if test="%{authLicence('2_2_1',site.siteId)}">
						<input type="button" value="<s:text name="disable"/>" class="stopuse" id="top_disable_btn" />
					</s:if>
					<s:else>
						<input type="button" disabled="disabled" value="<s:text name="disable"/>" class="btnlist2" id="top_disable_btn" />
					</s:else>
				
				</td>
			</tr>
			</s:if>
			<tr>
				<th><s:text name="site.siteName"/>:</th>
				<td colspan="3">
					<s:textfield id="siteName" name="site.siteName" maxlength="15" required="true" requiredposition="right" cssClass="txtin" onkeyup="check()"/>
					<span style="color: red">*</span><span id="namePointMessage"></span>
				</td>
			</tr>
			<tr>
				<th><s:text name="site.siteShortName"/>:</th>
				<td colspan="3"><s:textfield id="newsiteShortName" name="site.siteShortName" maxlength="20" required="true" requiredposition="right" cssClass="txtin" onkeyup="this.value=this.value.replace(/[\W]|[A-Z]/g,'')" onchange="this.value=this.value.replace(/[\W]|[A-Z]/g,'')"/>
					<span style="color: red">*</span><span id="siteShortNamespan" style="color: #457d07">(友情提示:只能输入20个由小写字母、数字、下划线组成的字符)</span><span id="shorPointMessage" style="color: #457d07"></span><span id="telMessage" style="color: #457d07"></span>
				</td>
			</tr>
			<tr>
				<th><s:text name="site.siteDomain"/>:</th>
				<td colspan="3"><s:textfield id="siteDomain" name="site.siteDomain" required="true" requiredposition="right" cssClass="txtin"  />
					<span style="color: red" id="siteDomainno"></span><span style="color: #457d07">(请输入正确的域名格式，例如：www.grayrabbit.com或http://www.grayrabbit.com)</span>
				</td>
			</tr>
			<tr>
				<th><s:text name="site.siteRootPath"/>:</th>
				<td colspan="3"><s:if test="site.siteId == null"><s:textfield name="site.siteRootPath" required="true" requiredposition="right" cssClass="txtin"/></s:if>
				<s:else><s:textfield name="site.siteRootPath" required="true" requiredposition="right" cssClass="txtin unable" readonly="true"/></s:else>
				<span style="color:#457d07">(此路径将作为您的站点的网络路径，一旦填写递交后不可修改，请务必谨慎操作！！)</span>
				</td>
			</tr>
			<tr>
				<th><s:text name="site.siteTheme"/>:</th>
				<td colspan="3">
					<select name="site.siteTheme" id="siteThemeName" required="true" requiredposition="right" ></select> 
					<span style="color: red">*</span><span id="themePointMessage"></span>
					<a id="previewbtn" href="javascript:preview()">主题预览</a>
				</td>
			</tr>
			<tr>
				<th><s:text name="area"/>: </th>
				<td colspan="3">
					<c:if test="${site.area != null }">
						<div class="area_alredy">
							<span><s:property value="%{getSiteAreaValue(site.area)}"/></span>
							<div>
								<s:select list="dicArea" cssClass="selectNor m01500 w130" id="country" name="countryArea" headerKey="" headerValue="请选择" listKey="dictionaryKey" listValue="dictionaryValue" onchange="getProvince()"></s:select>
								<s:select list="#{}" cssClass="selectNor m01500 w150" id="province" name="provinceArea" headerKey="" headerValue="请选择" listKey="dictionaryKey" listValue="dictionaryValue" onchange="getCity()"></s:select>
								<s:select list="#{}" cssClass="selectNor m01500 w130" id="city" name="cityArea" headerKey="" headerValue="请选择" listKey="dictionaryKey" listValue="dictionaryValue"></s:select>
							</div>
						</div>
					</c:if>
					<c:if test="${site.area == null }">
						<s:select list="dicArea" cssClass="selectNor m01500 w130" id="country" name="countryArea" headerKey="" headerValue="请选择" listKey="dictionaryKey" listValue="dictionaryValue" onchange="getProvince()"></s:select>
						<s:select list="#{}" cssClass="selectNor m01500 w150" id="province" name="provinceArea" headerKey="" headerValue="请选择" listKey="dictionaryKey" listValue="dictionaryValue" onchange="getCity()"></s:select>
						<s:select list="#{}" cssClass="selectNor m01500 w130" id="city" name="cityArea" headerKey="" headerValue="请选择" listKey="dictionaryKey" listValue="dictionaryValue"></s:select>
					</c:if>
				</td>
			</tr>
			<tr>
				<th><s:text name="site.siteType"/>:</th>
				<td colspan="3">
				 <s:if test="site.siteType == 'remote'">
				 <s:hidden name="isRemote" value ="1" id="isRemote"/>
					<input type="radio" name="site.siteType" required="true" requiredposition="right"  value="local"  onclick="hideRemote()"/><s:text name="local"/>
					<input type="radio" name="site.siteType" required="true" requiredposition="right"  value="remote" checked="checked" onclick="showRemote()"/><s:text name="remote"/>
				 </s:if>
				 <s:else>
				  <s:hidden name="isLocal" value ="0" id="isLocal"/>
				 	<input type="radio" name="site.siteType" required="true" requiredposition="right"  value="local"  checked="checked"  onclick="hideRemote()"/><s:text name="local"/>
					<input type="radio" name="site.siteType" required="true" requiredposition="right"  value="remote" onclick="showRemote()"/><s:text name="remote"/>
				 </s:else>
				</td>
			</tr>
			<tr id="siteIp">
					<th ><s:text name="site.siteIp"/>:</th>
					<td  colspan="3"><s:textfield name="site.siteIp" required="true" requiredposition="right" cssClass="txtin" /></td>
			</tr>
			 <tr id="siteLoginName">
			 	<th><s:text name="site.siteLoginName"/>:</th>
				<td colspan="3"><s:textfield name="site.siteLoginName" required="true" requiredposition="right" cssClass="txtin" /></td>
			</tr>
			<tr id="siteLoginPassword">
				<th><s:text name="site.siteLoginPassword"/>:</th>
				<td colspan="3"><s:textfield name="site.siteLoginPassword" required="true" requiredposition="right" cssClass="txtin" /></td>
			</tr>
			<tr id="siteSecondDomain">
				<th><s:text name="site.siteSecondDomain"/>:</th>
				<td colspan="3"><s:textfield name="site.siteSecondDomain" maxlength="15" required="true" requiredposition="right" cssClass="txtin" onblur="checkSecondDomin()"/>
					<span style="color: red" id="secondDomaininfo"></span><span style="color: #457d07">(请输入正确的域名格式，例如：www.grayrabbit.com或http://www.grayrabbit.com)</span>
				</td>
			</tr>
			<tr id="siteVirtualHosting">
				<th><s:text name="site.siteVirtualHosting"/>:</th>
					<td colspan="3">
						<s:if test="dicIsVirtualHosting!=null && site.siteId!=null">
							<s:radio name="site.siteVirtualHosting" list="dicIsVirtualHosting" listKey="dictionaryKey" listValue="dictionaryValue" 
							value="site.siteVirtualHosting" id="siteHost" key="1" cssClass="1"/>
						</s:if>
						<s:elseif test="dicIsVirtualHosting!=null && site.siteId==null">
							<s:radio name="site.siteVirtualHosting" list="dicIsVirtualHosting" listKey="dictionaryKey" listValue="dictionaryValue" 
							value="true" id="siteHost" key="2" cssClass="2"/>
						</s:elseif>
					</td>
			</tr>
			<%-- <tr>
				<th><s:text name="本站Logo"/>:</th>
				<td colspan="3">
					<s:file name="upload" id="siteLogo" cssClass="normal w350" onchange="onUploadImgChange(this)" size="85" cssStyle="hight:200px;"/>
				</td>
			</tr>
			<tr>
				<th><s:text name="Logo预览"/>:</th>
				<td colspan="3">
					<div class="t_img2" id="preview_fake">
		                 <s:if test="site.logo!=null">
		                 	<img src="<s:property value="uploadUrl"/><s:property value="site.logo"/>" title="<s:text name="site.logo"/>" id="pictemp2" />
		                 </s:if>
		                 <s:else> 
		                 	<img src="${ctx}/imgs/front/zw_tu.png" title="<s:text name="site.logo"/>"  id="pictemp2" />
		                 </s:else>
                	</div>
                	<img id="preview_size_fake" class="none" src=""/>
				</td>
			</tr> --%>
			<tr>
				<th><s:text name="本站Logo"/>:</th>
				<td colspan="3">
					
				</td>
			</tr>
			<tr>
				<th><s:text name="Logo预览"/>:</th>
				<td colspan="3" style="height:97px;">
				</td>
			</tr>
			<tr>
				<th><s:text name="banner上传"/>:</th>
				<td colspan="3">
					
				</td>
			</tr>
			<tr>
				<th><s:text name="banner预览"/>:</th>
				<td colspan="3" style="height:97px;">
				</td>
			</tr>
			<tr id="createTime">
				<th><s:text name="site.createTime"/>:</th>
				<td><s:textfield name="site.createTime" required="true" requiredposition="right" cssClass="txtin unable" readonly="true" ><s:param name="value"><s:date name="site.createTime" format="yyyy-MM-dd HH:mm:ss"/></s:param></s:textfield></td>
				<th id="updateTimeTh"><s:text  name="site.updateTime"/>:</th>
				<td id="updateTime"><s:textfield  name="site.updateTime" required="true" requiredposition="right" cssClass="txtin unable" readonly="true" ><s:param name="value"><s:date name="site.updateTime" format="yyyy-MM-dd HH:mm:ss"/></s:param></s:textfield></td>
			</tr>
			<tr id="createLoginName">
				<th><s:text name="site.createLoginName"/>:</th>
				<td><s:textfield name="site.createLoginName" required="true" requiredposition="right" cssClass="txtin unable" readonly="true"/></td>
				<th><s:text name="site.updateLoginName"/>:</th>
				<td><s:textfield id="updateLoginName" name="site.updateLoginName" required="true" requiredposition="right" cssClass="txtin unable" readonly="true"/></td>
			</tr>
			<tr id="createRealName">
				<th><s:text name="site.createRealName"/>:</th>
				<td class="w30p"><s:textfield name="site.createRealName" required="true" requiredposition="right" cssClass="txtin unable" readonly="true"/></td>
				<th><s:text name="site.updateRealName"/>:</th>
				<td><s:textfield id="updateRealName" name="site.updateRealName" required="true" requiredposition="right" cssClass="txtin unable" readonly="true"/></td>
				
			</tr>
			<%-- <tr>
				<th>&nbsp;</th>
				<td colspan="3">
				<s:if test="site.siteId != null">
					<s:if test="%{authLicence('2_2_1',site.siteId) || authLicence('1_1_5')}">
						<input type="button" value="<s:text name="save"/>" class="btnlist2" id="save_button" name="save_button"/>
					</s:if> 
					<s:else>
						<s:submit disabled="true" value="%{getText('save')}" cssClass="btnlist2"/>
					</s:else>
					<s:if test="%{authLicence('2_2_1',site.siteId)}">
						<input type="button" value="<s:text name="delete"/>" class="btnlist2" id="top_del_btn2" />
					</s:if>
					<s:else>
						<input type="button" disabled="disabled" value="<s:text name="delete"/>" class="btnlist2" id="top_del_btn" />
					</s:else>
					<s:if test="%{authLicence('2_2_1',site.siteId)}">
						<input type="button" value="<s:text name="disable"/>" class="stopuse" id="top_disable_btn2" />
					</s:if>
					<s:else>
						<input type="button" disabled="disabled" value="<s:text name="disable"/>" class="btnlist2" id="top_disable_btn" />
					</s:else>
				</s:if>
				<s:else>
					<s:if test="%{authLicence('1_1_5')}">
						<input type="button" value="<s:text name="save"/>" class="btnlist2" id="save_button" name="save_button"/>
					</s:if>
					<s:else>
						<s:submit disabled="true" value="%{getText('save')}" cssClass="btnlist2"/>
					</s:else>
				</s:else>
				</td>
			</tr> --%>
		</table>
		<table class="addgrid" id="at" style="display: none">
			<tr>
				<td align="center"><s:text name="配置项"/></th>
				<td align="center"><s:text name="参数值"/></th>
			</tr>
			<tr>
				<th><s:text name="小图片尺寸"/>:</th>
				<td>
					<s:textfield  name="site.smallPictureSize" required="true" maxlength='64'  requiredposition="right" cssClass="txtin" onkeyup="check()"/>
					<span style="color: #457d07">(高和宽用下划线隔开，例：137_83 )</span>
				</td>
			</tr>
			<tr>
				<th><s:text name=" 中图片尺寸"/>:</th>
				<td>
					<s:textfield   name="site.middlePictureSize" required="true" maxlength='64'  requiredposition="right" cssClass="txtin" onkeyup="check()"/>
					<span style="color: #457d07">(高和宽用下划线隔开，例：137_83 )</span>
				</td>
			</tr>
			<tr>
				<th><s:text name="大图片尺寸"/>:</th>
				<td>
					<s:textfield   name="site.bigPictureSize" required="true" maxlength='64'  requiredposition="right" cssClass="txtin" onkeyup="check()"/>
					<span style="color: #457d07">(高和宽用下划线隔开，例：137_83 )</span>
				</td>
			</tr>
			<tr>
				<th><s:text name="图片类型"/>:</th>
				<td>
					<s:textfield   name="site.picType" required="true" maxlength='64'  requiredposition="right" cssClass="txtin" onkeyup="check()"/>
					<span style="color: #457d07">(类型之间用 | 隔开，例：jpg|gif|png )</span>
				</td>
			</tr>
			<tr>
				<th><s:text name="动画类型"/>:</th>
				<td>
					<s:textfield   name="site.cartoonType" required="true" maxlength='64'  requiredposition="right" cssClass="txtin" onkeyup="check()"/>
					<span style="color: #457d07">(类型之间用 | 隔开，例：swf|mpg |rm|rmvb|wmv|wma|wav|mid|mov )</span>
				</td>
			</tr>
			<tr>
				<th><s:text name="视频类型"/>:</th>
				<td>
					<s:textfield   name="site.videoType" required="true" maxlength='64'  requiredposition="right" cssClass="txtin" onkeyup="check()"/>
					<span style="color: #457d07">(类型之间用 | 隔开，例：swf|mpg |rm|rmvb|wmv|wma|wav|mid|mov )</span>
				</td>
			</tr>
			<tr>
				<th><s:text name="软件类型"/>:</th>
				<td>
					<s:textfield   name="site.softWareType" required="true" maxlength='64'  requiredposition="right" cssClass="txtin" onkeyup="check()"/>
					<span style="color: #457d07">(类型之间用 | 隔开，例：exe|iso|zip|7z|rar|gz )</span>
				</td>
			</tr>
			<tr>
				<th><s:text name="图片附件大小控制"/>:</th>
				<td>
					<s:textfield   name="site.pictureAdvice" required="true" maxlength='11'  requiredposition="right" cssClass="txtin" onkeyup="this.value=this.value.replace(/\D/g,'')" />
					<span style="color: #457d07">(M)</span> <span style="color: #457d07">(最多只能输入11位的数字 )</span>
				</td>
			</tr>
			<tr>
				<th><s:text name="动画附件大小控制"/>:</th>
				<td>
					<s:textfield   name="site.cartoonAdvice" required="true" maxlength='11'  requiredposition="right" cssClass="txtin" onkeyup="this.value=this.value.replace(/\D/g,'')" />
					<span style="color: #457d07">(M)</span> <span style="color: #457d07">(最多只能输入11位的数字 )</span>
				</td>
			</tr>
			<tr>
				<th><s:text name="视频附件大小控制"/>:</th>
				<td>
					<s:textfield   name="site.videoAdvice" required="true" maxlength='11'  requiredposition="right" cssClass="txtin" onkeyup="this.value=this.value.replace(/\D/g,'')" />
					<span style="color: #457d07">(M)</span> <span style="color: #457d07">(最多只能输入11位的数字 )</span>
				</td>
			</tr>
			<tr>
				<th><s:text name="软件附件大小控制"/>:</th>
				<td>
					<s:textfield   name="site.softwareAdvice" required="true" maxlength='11'  requiredposition="right" cssClass="txtin" onkeyup="this.value=this.value.replace(/\D/g,'')" />
					<span style="color: #457d07">(M)</span> <span style="color: #457d07">(最多只能输入11位的数字 )</span>
				</td>
			</tr>
			<%-- <tr>
				<td colspan="2" align="center">
					<s:submit value="%{getText('save')}" cssClass="btnlist2" id="save_at_button"/>	<span style="color: #457d07">(请将站点基本信息填写完成后再保存！)</span>	 
				</td>
			</tr> --%>
		</table>
		<table id="ot"  class="addgrid" style="display: none">
			<tr>
				<th><s:text name="版权所有"/>:</th>
				<td>
					<s:textfield  name="site.copyright" required="true" maxlength='64'  requiredposition="right" cssClass="txtin" onkeyup="check()"/>
				</td>
			</tr>
			<tr>
				<th><s:text name="地址"/>:</th>
				<td>
					<s:textfield  name="site.address" required="true" maxlength='256'  requiredposition="right" cssClass="txtin" onkeyup="check()"/>
				</td>
			</tr>
			<tr>
				<th><s:text name="邮政编码"/>:</th>
				<td>
					<s:textfield  name="site.postalCode" required="true" maxlength='32'  requiredposition="right" cssClass="txtin" onkeyup="check()"/>
				</td>
			</tr>
			<tr>
				<th><s:text name="备案号"/>:</th>
				<td>
					<s:textfield  name="site.recordNumber" required="true" maxlength='32'  requiredposition="right" cssClass="txtin" onkeyup="check()"/>
				</td>
			</tr>
			<tr>
				<th><s:text name="技术支持"/>:</th>
				<td>
					<s:textfield  name="site.technicalSupport" required="true" maxlength='32'  requiredposition="right" cssClass="txtin" onkeyup="check()"/>
				</td>
			</tr>
			<tr>
				<th><s:text name="网站管理员邮箱"/>:</th>
				<td>
					<s:textfield id="adminEmail"  name="site.adminEmail" required="true" maxlength='64'  requiredposition="right" cssClass="txtin" onblur="checkEmail()"/>
					<span id="emailMsg"></span>
				</td>
			</tr>
			<%-- <tr>
				<td colspan="2" align="center">
					<s:submit value="%{getText('save')}" cssClass="btnlist2" id="save_ot_button"/>	<span style="color: #457d07">(请将站点基本信息填写完成后再保存！)</span>	 
				</td>
			</tr> --%>
		</table>
		<table>
			<br/>
			<tr>
				<th>&nbsp;</th>
				<td colspan="3">
				<s:if test="site.siteId != null">
					<s:if test="%{authLicence('2_2_1',site.siteId) || authLicence('1_1_5')}">
						<input type="button" value="<s:text name="save"/>" class="btnlist2" id="save_button" name="save_button"/>
					</s:if> 
					<s:else>
						<s:submit disabled="true" value="%{getText('save')}" cssClass="btnlist2"/>
					</s:else>
					<s:if test="%{authLicence('2_2_1',site.siteId)}">
						<input type="button" value="<s:text name="delete"/>" class="btnlist2" id="top_del_btn2" />
					</s:if>
					<s:else>
						<input type="button" disabled="disabled" value="<s:text name="delete"/>" class="btnlist2" id="top_del_btn" />
					</s:else>
					<s:if test="%{authLicence('2_2_1',site.siteId)}">
						<input type="button" value="<s:text name="disable"/>" class="stopuse" id="top_disable_btn2" />
					</s:if>
					<s:else>
						<input type="button" disabled="disabled" value="<s:text name="disable"/>" class="btnlist2" id="top_disable_btn" />
					</s:else>
				</s:if>
				<s:else>
					<s:if test="%{authLicence('1_1_5')}">
						<input type="button" value="<s:text name="save"/>" class="btnlist2" id="save_button" name="save_button"/>
					</s:if>
					<s:else>
						<s:submit disabled="true" value="%{getText('save')}" cssClass="btnlist2"/>
					</s:else>
				</s:else>
				<span style="color: #457d07">(如果不能点击保存，请先检查是否正确填写站点基本信息)</span>
				</td>
			</tr>
		</table>
		</s:form>
		<s:form name="uploadForm" id="uploadForm" target="hidden_frame"  enctype="multipart/form-data">
			<s:hidden name="siteLogoPhysicalPath"></s:hidden>
			<!-- <input name="uploadType" type="hidden"/> -->
		<s:if test="site.siteId==null"><s:property value="site.siteId"/>
			<div class="padding6-14" style="margin-top:-297px;margin-left:140px;" id="upimg_div">
		</s:if>
		<s:else>
			<div class="padding6-14" style="margin-top:-390px;margin-left:140px;" id="upimg_div">
		</s:else>
				    <table id="upLogo">
					<tr>
						<td height=30>
							<s:file name="upload" id="siteLogo" cssClass="normal w350" onchange="onUploadImgChange(this.value,this,1)" size="85" cssStyle="hight:200px;"/>
						</td>
					</tr>
					<tr>
						<td>
							<div class="t_img2" id="preview_fake" >
				                 <s:if test="site.logo!=null">
				                 	<img src="<s:property value="uploadUrl"/><s:property value="site.logo"/>" title="<s:text name="site.logo"/>" id="pictemp2" />
				                 </s:if>
				                 <s:else> 
				                 	<img src="${ctx}/imgs/front/zw_tu.png" title="<s:text name="site.logo"/>"  id="pictemp2"  />
				                 </s:else>
               				</div>
						</td>
					</tr>
					<iframe name='hidden_frame' id='hidden_frame' style='display:none'></iframe>
				</table>                   
			 </div>
		</s:form>
		<!-- banner上传 -->
		<s:form name="uploadForm" id="uploadForm" target="hidden_frame"  enctype="multipart/form-data">
			<s:hidden name="siteBannerPhysicalPath"></s:hidden>
			<!-- <input name="uploadType" type="hidden"/> -->
		<s:if test="site.siteId==null"><s:property value="site.siteId"/>
			<div class="padding6-14" style="margin-top:1px;margin-left:140px;" id="upimg_div">
		</s:if>
		<s:else>
			<div class="padding6-14" style="margin-top:0px;margin-left:140px;" id="upimg_div">
		</s:else>
				    <table id="upBanner">
					<tr>
						<td height=30>
							<s:file name="upload" id="siteLogo" cssClass="normal w350" onchange="onUploadImgChange(this.value,this,2)" size="85" cssStyle="hight:200px;"/>
						</td>
					</tr>
					<tr>
						<td>
							<div class="t_img2" id="preview_fake" >
				                 <s:if test="site.logo!=null">
				                 	<img src="<s:property value="uploadUrl"/><s:property value="site.banner"/>" title="<s:text name="site.banner"/>" id="pictemp3" />
				                 </s:if>
				                 <s:else> 
				                 	<img src="${ctx}/imgs/front/zw_tu.png" title="<s:text name="site.banner"/>"  id="pictemp3"  />
				                 </s:else>
               				</div>
						</td>
					</tr>
					<iframe name='hidden_frame' id='hidden_frame' style='display:none'></iframe>
				</table>                   
			 </div>
		</s:form>
		<!-- end -->
	</div>
</div>
<!-- 主题预览 -->
<div id="lightbox" class="lightbox">
	<div class="lighttit"><p><span><input type="button" value="&nbsp;" id="lightclose" class="lightclose" /><strong>站点主题预览</strong></span></p></div>
	<div class="lightmain">
		<div class="lightmaintit"></div>
		<div class="ilghtmainbox">
			<img width="500" height="400" title="缩略图" src="" id="src_1"></img>
		</div>
		<div class="lightbtnbox"><input type="button" id="closebtn" value="关闭"  class="btnlist2" /></div>
	</div>
</div>
<!-- end -->
</body>
</html>
<script type="text/javascript" defer="defer">

 
	//根据id删除站点
	actionName = "site";
    confirmStr = "<s:text name="delete.confirm"/>";
	var siteid = $("#siteId").val();
	$('#top_del_btn').bind("click",function(){   
	    goDelSite(siteid);
	});
	$('#top_del_btn2').bind("click",function(){   
	    goDelSite(siteid);
	});
	
	var isNotSave = true;
	window.onbeforeunload = function () {
		if(isNotSave) {
			var siteLogoPhysicalPath = $("input[name=siteLogoPhysicalPath]").val();
			$.post("${ctx}/site/delete-excessPicture.action?siteLogoPhysicalPath="+siteLogoPhysicalPath);
			
			var siteBannerPhysicalPath = $("input[name=siteBannerPhysicalPath]").val();
			$.post("${ctx}/site/delete-excessPicture.action?siteLogoPhysicalPath="+siteBannerPhysicalPath);
			
			
		}
	}
	//删除
	function goDelSite(id){
		
		$.post("${ctx}/site/site-checksite.action?key="+id,function(data){
			if(data == "havacat"){
				alert("站点中包含栏目，不能删除");
			}else if(data == "havatop"){
				alert("站点中包含专题，不能删除");
			}else if(data == "havavote"){
				alert("站点中包含投票，不能删除");
			}else if(data == "havasurvey"){
				alert("站点中包含调查，不能删除");
			}else{
				if(confirm(confirmStr))
				document.location.href=actionName+"-delete.action?key="+id;
			}
		});
	}
	//改变禁用状态
	$('#top_disable_btn').bind("click",function(){
		var url=self.parent.leftframe.goDisable(siteid);
		window.location.href=url;
	}); 
	$('#top_disable_btn2').bind("click",function(){
		var url=self.parent.leftframe.goDisable(siteid);
		window.location.href=url;
	});
	//打开新增页面(siteId为空)时隐藏
	if(siteid == null || siteid ==""){
		$("#top_del_btn").hide();
		$("#top_del_btn2").hide();
		$("#top_disable_btn").hide();
		$("#top_disable_btn2").hide();
		$("#createTime").hide();
		$("#createLoginName").hide();
		$("#createRealName").hide();
		$("#updateTime").hide();
		$("#updateLoginName").hide();
		$("#updateRealName").hide();
	}
	
	//校验（null）
	
	function trim(strToTrim){
  	  return strToTrim.replace(/^\s+|\s+$/g,"");
  }
	var isUni="no";
	var domin = "ok";
	var secondDomin = "ok";
	function chkform(){
		var sName = $("#siteName").val();
		var ShortName = $("#siteShortName").val();
		var siteShortName = ShortName.replace(/(^\s*)|(\s*$)/g, "");
		var siteDomain = $("#siteDomain").val();
		var siteTheme = $("#siteThemeName").val();
		if(sName==null||$.trim(sName)==''){
			$("#namePointMessage").css("color","red");
			$("#namePointMessage").html("站点名称不能为空");
			return false;
		}
		else{
			$("#namePointMessage").html("");
		}
		if(siteTheme == null || siteTheme == "" || siteTheme == "-1"){
			$("#themePointMessage").css("color","red");
			$("#themePointMessage").html("站点主题必须选择");
			return false;
		}
		else{
			$("#themePointMessage").html("");
		}
		checkUniName();
		if(isUni == "have"){
			return false;
		}
		var siteShortName=$("#newsiteShortName").val();
		if(siteShortName==null||siteShortName==""){
			$("#shorPointMessage").html("站点简称不能为空!");
			$("#shorPointMessage").css("color","red");
			return false; 
		}
		/* var telMessage=$("#telMessage").val();
		if(telMessage!="yes"){
			$("#shorPointMessage").html("站点简称已注册!");
			$("#shorPointMessage").css("color","red");
			return false; 
		} */
		//search();
		checksiteDomain();
		if( domin != "ok"){
			$("#siteDomainno").html("您输入的格式有误！");
			return false;
		}
		
		if( secondDomin != "ok"){
			$("#secondDomaininfo").html("您输入的格式有误！");
			return false;
		}
		
		$("#saveForm").submit();
	}
	$("input[name=save_button]").click(function(){
		isNotSave = false;
		var siteShortName=$("#newsiteShortName").val();
		var oldSimpleName=$("#siteShortName").val();
		var obj={"site.siteShortName":siteShortName,"oldSimpleName":oldSimpleName};
		if(siteShortName==null||siteShortName==""){
			$("#shorPointMessage").html("站点简称不能为空");
			$("#shorPointMessage").css("color","red");
		} else{
			$.ajax({
				type:"POST",
				async:false,
				data:obj,
				url:"${ctx}/site/site-checkSimplenameunique.action",
				success:function(data){
					if(data=="no"){
						$("#shorPointMessage").html("站点简称已注册!");
						$("#shorPointMessage").css("color","red");//telMessage
						$("#telMessage").val("no");
						return false;
					}else if(data=="yes"){
						$("#shorPointMessage").html("");
						$("#shorPointMessage").css("color","red");
						$("#telMessage").val("yes");
						chkform();
					}
				}
			});	
		}
	});
		
	
	//输入1秒后检测用户名
	 var timer = false;
     function check() {
  	 if (timer) {
           clearTimeout(timer);
           timer = false;
    }
 	 timer = setTimeout(function () {
		   checkUniName();
 	 }, 1000);
	}
	//进行站点名称唯一检测
	function checkUniName(){
		var stname = $("#sitename").val();
		var siteName = $("#siteName").val();
		var obj = {"site.siteName":siteName,"stname":stname};
		if(siteName != null && siteName != ""){			
			 $.ajax({
					type:"POST",
					async:false,
					data:obj,
					url:"${ctx}/site/site-checknameunique.action",
					success:function(data){
						if(data == "ok"){
							$("#namePointMessage").css("color","#457d07");
							$("#namePointMessage").html("站点名可用");
							isUni="no";
						}else{
							$("#namePointMessage").css("color","red");
							$("#namePointMessage").html("站点名已经被占用，请重新输入");
							isUni="have";
							return false;
					   }
					}
				});	
		  }
	}
	
	var isLocal = $("#isLocal").val();
	if(isLocal == 0){
		$("#siteSecondDomain").show();
		$("#siteVirtualHosting").show();
		$("#siteIp").hide();
		$("#siteLoginName").hide();
		$("#siteLoginPassword").hide();
	}
	
	//显示远程信息
	var isRemote = $("#isRemote").val();
	if(isRemote == 1){
		$("#siteSecondDomain").hide();
		$("#siteVirtualHosting").hide();
		$("#siteIp").show();
		$("#siteLoginName").show();
		$("#siteLoginPassword").show();
	}

	//选择远程，显示远程信息
	function showRemote(){
		$("#siteSecondDomain").hide();
		$("#siteVirtualHosting").hide();
		$("#siteIp").show();
		$("#siteLoginName").show();
		$("#siteLoginPassword").show();
	}
	
	//选择本地，隐藏远程信息
	function hideRemote(){
		$("#siteVirtualHosting").show();
		$("input[name=site.siteVirtualHosting]").show(siteHost);
		$("#siteIp").hide();
		$("#siteLoginName").hide();
		$("#siteLoginPassword").hide();
	}
	//判断是否隐藏二级域名
	function siteHost(){
		var sh = $('input[name=site.siteVirtualHosting]:checked').val();
		if(sh=='true'){
			$("#siteSecondDomain").show();
		}else{
			$("#siteSecondDomain").hide();
		}
	}
	$(function(){
		$("input[name=site.siteVirtualHosting]").change(siteHost);
		$("#siteThemeName").change(function(){
			var siteTheme = $("#siteThemeName").val();
			if(siteTheme == null || siteTheme == "-1"){
				$("#themePointMessage").css("color","red");
				$("#themePointMessage").html("站点主题必须选择");
				return false;
			}
			else{
				$("#themePointMessage").html("");
			}
		});
		$("#siteName").blur(function(){
			var sName = $("#siteName").val();
			if(sName==null||$.trim(sName)==''){
				$("#namePointMessage").css("color","red");
				$("#namePointMessage").html("站点名称不能为空");
				return false;
			}
			else{
				$("#namePointMessage").html("");
			}
		});

		
	});
	
	$.ajax({
		url:"${ctx}/theme/theme-select.action?t="+new Date().getTime(),
		data:{'themeName':'<s:property  value="site.siteTheme"/>'},
		type:'post',
		dataType:'html',
		success:function(data){
			$("#siteThemeName").html(data);
		}
	});
	///匹配域名 
	$(function(){
		$("#siteDomain").blur(checksiteDomain);
	});
	
	function checksiteDomain(){
		var regular=$("input[name=site.siteDomain]").val();
		if(regular != null && regular != ""){
			if(!IsURL(regular)){
				$("#siteDomainno").html("您输入的格式有误！");
				 domin = "error";
			}else{
				$("#siteDomainno").html("");
				domin = "ok";
			}
		}
	}
	
	 function IsURL(str_url){
		  var strRegex = "^((https|http|ftp|rtsp|mms)?://)" 
		  + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" //ftp的user@ 
		        + "(([0-9]{1,3}.){3}[0-9]{1,3}" // IP形式的URL- 199.194.52.184 
		        + "|" // 允许IP和DOMAIN（域名）
		        + "([0-9a-z_!~*'()-]+.)*" // 域名- www. 
		        + "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]." // 二级域名 
		        + "[a-z]{2,6})" // first level domain- .com or .museum 
		        + "(:[0-9]{1,4})?" // 端口- :80 
		        + "((/?)|" // a slash isn't required if there is no file name 
		        + "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$"; 
		        var re=new RegExp(strRegex); 
		        if (re.test(str_url)){
		            return (true); 
		        }else{ 
		            return (false); 
		        }
		    }
	
	 //检测二级域名
	 function checkSecondDomin(){
			var regular=$("input[name=site.siteSecondDomain]").val();
			if(regular != null && regular != ""){
				if(!IsURL(regular)){
					$("#secondDomaininfo").html("您输入的格式有误！");
					secondDomin = "error";
				}else{
					$("#secondDomaininfo").html("");
					secondDomin = "ok";
				}
			}
	 }
	 
	//主题预览
	function preview(){
		var siteTheme = $("#siteThemeName").val();
		if(siteTheme=='-1'){
			alert("请选择主题"); 
			$("#previewbtn").attr('showflag','true');
		}else{
			$$.shade("#previewbtn","#lightclose,#closebtn,#lightsubmit","#lightbox");
			$("#src_1").attr("src","<s:property value="#session['THEME_VISIT_URL']"/>"+"theme/"+siteTheme+"/thumb.jpg"); 
		}
	}
	/// 站点简称唯一性校验
	$(function(){
		$("#newsiteShortName").blur(function(){
			var siteShortName=$("#newsiteShortName").val();
			if(siteShortName==null||siteShortName==""){
				$("#shorPointMessage").html("站点简称不能为空!");
				$("#shorPointMessage").css("color","red");
			
			}else{
				$("#shorPointMessage").html("");
				$("#shorPointMessage").css("color","red");
			}
		});
		$("#newsiteShortName").blur(function(){
			var siteShortName=$("#newsiteShortName").val();
			var oldSimpleName=$("#siteShortName").val();
			var obj={"site.siteShortName":siteShortName,"oldSimpleName":oldSimpleName};
			if(siteShortName==null||siteShortName==""){
				$("#shorPointMessage").html("站点简称不能为空");
				$("#shorPointMessage").css("color","red");
			} else{
				$.post(
						"${ctx}/site/site-checkSimplenameunique.action",
						obj,
						function(data){
							if(data=="no"){
								$("#shorPointMessage").html("站点简称已注册!");
								$("#shorPointMessage").css("color","red");//telMessage
								$("#telMessage").val("no");
								/* $("#save_button").attr("disabled","disabled"); */
								$("input[name=save_button]").attr("disabled","disabled");
							}if(data=="yes"){
								$("#shorPointMessage").html("");
								$("#shorPointMessage").css("color","red");
								$("#telMessage").val("yes");
								/* $("#save_button").attr("disabled",""); */
								$("input[name=save_button]").attr("disabled","");
							}
						}
				);
			} 
		
		});
	});
	
	//获得二级区域
	function getProvince(){
		$("#province option").remove();
		$("#city option").remove();
		var parentKey = $("#country").val();
		if(parentKey == ""){
			$("#province").append("<option value=''>-----请选择-----</option>");
		}else{
			var obj = {"parentKey":parentKey};
			$.post("${ctx}/front/esp/espadmin-getcity.action", obj, function(data){
				var json = eval('('+data+')');
				var dicIds = json.dicIds.split("@");
				var dicKeys = json.dicKeys.split("@");
				var dicValues = json.dicValues.split("@");
				var str = "";
				str+="<option value=''>-----请选择-----</option>";
				$("#city").append("<option value=''>-----请选择-----</option>");
				for(var i = 0 ; i < dicIds.length ; i++){
					str+="<option value='"+dicKeys[i]+"'>"+dicValues[i]+"</option>";
				}
				$("#province").append(str);
			});
		}
	}
	//获取三级区域
	function getCity(){
		$("#city option").remove();
		var parentKey = $("#province").val();
		if(parentKey == ""){
			$("#city").append("<option value=''>-----请选择-----</option>");
		}else{
			var obj = {"parentKey":parentKey};
			$.post("${ctx}/front/esp/espadmin-getcity.action", obj, function(data){
				if(!!data){
					$("#city").attr("disabled",false);
					var json = eval('('+data+')');
					var dicIds = json.dicIds.split("@");
					var dicKeys = json.dicKeys.split("@");
					var dicValues = json.dicValues.split("@");
					var str = "";
					str+="<option value=''>-----请选择-----</option>";
					for(var i = 0 ; i < dicIds.length ; i++){
						str+="<option value='"+dicKeys[i]+"'>"+dicValues[i]+"</option>";
					}
					$("#city").append(str);
				}else{
					var option = $("#province").find("option:selected");
					var key = option.attr("value");
					var value = option.html();
					$("#city").append("<option value='"+key+"'>"+value+"</option>");
				}
			});
		}
	}
	var isPass = false;
	function onUploadImgChange (url, sender , lx) {
		var agent=window.navigator.userAgent;
		var isIE8 = agent.indexOf('MSIE 8.0') != -1;
		var objPreviewFake = document.getElementById( 'preview_fake' );
		var fileExt = url.substring(url.lastIndexOf(".")).toLowerCase();
		if(!checkFileExt(fileExt)) {
			alert("您上传的文件不是图片,请重新上传！");
			return false;
		}
		if( sender.files &&  sender.files[0] ){
			//在fireFox和chrome中。浏览器实现了File Api，是调用FileReader接口，readAsDataURL()用来读文件，onload事件为文件读取成功后触发
			if(sender.files[0].size > 1024*100) {
				alert("您上传的文件过大,请上传小于100k的图片！");
				isPass = false;
			}else {
				isPass = true;
			}
		}else if(isIE8 && objPreviewFake.filters ){
			// IE7,IE8 在设置本地图片地址为 img.src 时出现莫名其妙的后果
			//（相同环境有时能显示，有时不显示），因此只能用滤镜来解决图片预览，用ActiveXObject来获取图片大小
			// IE7, IE8因安全性问题已无法直接通过 input[file].value 获取完整的文件路径
			sender.select();
			var imgSrc = document.selection.createRange().text;
			var fso = new ActiveXObject("scripting.filesystemobject");
			//读取图片文件大小
			if(fso.GetFile(imgSrc).size >= 1024*100){
				alert("您上传的文件过大,请上传小于100k的图片！");
				isPass = false;
			}else {
				isPass = true;
			}
		}else {
			//IE环境下
			sender.select();
			var imgSrc = document.selection.createRange().text;
			//读取图片文件大小
			var sh = setInterval(function(){
				var img = document.createElement("img");
				img.src = imgSrc;
				var fileSize = img.fileSize;
				if (fileSize > 0){
					 if(fileSize > 1024*100) {
					        alert("您上传的文件过大,请上传小于100Kb的图片！");
					        clearInterval(sh);
					 }else {
						clearInterval(sh);
						var height=$('body').height()+71;
						$("body",parent.document).append('<div class="loading"><img src="imgs/loading_cms.gif" class="mb14" /><p class="c_fff">正在上传 请稍后 . . . </p></div><div class="shadow" style="height:'+height+'px;width:100%;"><iframe scrolling="no" height="'+height+'" frameborder="0" width="100%"   style="position:absolute;z-index:-1;border:none;filter:alpha(opacity=0);"></iframe></div>');
						var thisForm = sender.form;
						thisForm.action = "${ctx}/site/save-picture.action?url="+encodeURI(url)+"&upType="+lx;
						thisForm.submit();
					 }
				}
				img = null;
			},100);
		}
		if(isPass) {
			$("body",parent.document).append('<div class="loading"><img src="imgs/loading_cms.gif" class="mb14" /><p class="c_fff">正在上传 请稍后 . . . </p></div><div class="shadow" style="height:100%;width:100%;"></div>');
			var thisForm = sender.form;
			thisForm.action = "${ctx}/site/save-picture.action?url="+encodeURI(url)+"&upType="+lx;
			thisForm.submit();
		}
	}
	//上传附件-Logo
	/* function onUploadImgChange(sender){
		var agent=window.navigator.userAgent;
		var isIE8 = agent.indexOf('MSIE 8.0') != -1;
		var filePath = sender.value;
		var fileExt = filePath.substring(filePath.lastIndexOf(".")).toLowerCase();
		if(!checkFileExt(fileExt))
		{
		alert("您上传的文件不是图片,请重新上传！");
		$("input[name=save_button]").attr("disabled",true);
		return false;
		}
		else{
			$("#pic1").val(filePath);
		}
		var objPreview = document.getElementById( 'pictemp2' );
		var objPreviewFake = document.getElementById( 'preview_fake' );
		var objPreviewSizeFake = document.getElementById('preview_size_fake');
		try{
			if( sender.files &&  sender.files[0] ){
				//在fireFox和chrome中。浏览器实现了File Api，是调用FileReader接口，readAsDataURL()用来读文件，onload事件为文件读取成功后触发
				if(sender.files[0].size > 1024*100) {
					alert("您上传的文件过大,请上传小于100k的图片！");
					$("input[name=save_button]").attr("disabled",true);
					return false;
				}
				var reader = new FileReader();
				reader.onload = function(e) {
					$("#pictemp2").attr("src",this.result);
					$("input[name=save_button]").attr("disabled",false);
				};
				reader.readAsDataURL(sender.files[0]);
			}else if(isIE8 && objPreviewFake.filters ){
				// IE7,IE8 在设置本地图片地址为 img.src 时出现莫名其妙的后果
				//（相同环境有时能显示，有时不显示），因此只能用滤镜来解决图片预览，用ActiveXObject来获取图片大小
				// IE7, IE8因安全性问题已无法直接通过 input[file].value 获取完整的文件路径
				sender.select();
				var imgSrc = document.selection.createRange().text;
				var fso = new ActiveXObject("scripting.filesystemobject");
				//读取图片文件大小
				if(fso.GetFile(imgSrc).size >= 1024*100){
					alert("您上传的文件过大,请上传小于100k的图片！");
					$("input[name=save_button]").attr("disabled",true);
					$("#pic1").val("");
				}else {
					$("input[name=save_button]").attr("disabled",false);
				}
				objPreviewFake.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = imgSrc;
				objPreviewSizeFake.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = imgSrc;
				autoSizePreview( objPreviewFake,objPreviewSizeFake.offsetWidth, objPreviewSizeFake.offsetHeight);
				objPreview.style.display = 'none';
			}else {
				//IE6环境下
				sender.select();
				var imgSrc = document.selection.createRange().text;
				//读取图片文件大小
				var sh = setInterval(
					function(){
					var img = document.createElement("img");
					img.src = imgSrc;
					fileSize = img.fileSize;
					if(fileSize > 102400){
						alert("您上传的文件过大,请上传小于100k的图片！");
						$("input[name=save_button]").attr("disabled",true);
						$("#pic1").val("");
						clearInterval(sh);
					}else {
						$("input[name=save_button]").attr("disabled",false);
					}
					img = null;
				},100);
				objPreviewFake.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = imgSrc;
				objPreviewSizeFake.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = imgSrc;
				autoSizePreview( objPreviewFake,objPreviewSizeFake.offsetWidth, objPreviewSizeFake.offsetHeight);
				objPreview.style.display = 'none';
			}
		}catch(e)
		{
			 alert("您上传的文件过大或者不是图片,请重新上传！");
			 $("input[name=save_button]").attr("disabled",true);
			 $("#pic1").val("");
		}    
		var pic1=$("#siteLogo").val();
		$("#pic1").val(pic1);
	} */

	function onPreviewLoad(sender){
		autoSizePreview( sender, sender.offsetWidth, sender.offsetHeight );
	}

	function autoSizePreview( objPre, originalWidth, originalHeight ){
		objPre.style.width = 170 + 'px';
		objPre.style.height = 170 + 'px';
	}

	function checkFileExt(ext)
	{
	    if (!ext.match(/.jpg|.gif|.png|.bmp/i)) {
	        return false;
	    }
	    return true;
	}
	$(function(){
		$('body').click(function(){
			$(".area_alredy").children('div').hide(100);
		});
		$(".area_alredy").click(function(event){
			if ($(this).children('div').css('display')=="none"){
				$(this).children('div').stop().show(100);
			}else{
				$(".area_alredy").children('div').hide(100);
			}
			event.stopPropagation();
		});
		$(".area_alredy div").click(function(event){
			event.stopPropagation();
		});
		$(".area_alredy select").change(function(){
			var area_list="";
		    var Cts = "";     
			for (i=0;i<$(".area_alredy select").length;i++){
				Cts=$(".area_alredy select").eq(i).find("option:selected").text();
			    if(Cts.indexOf("请选择") < 0 ){    
			    	area_list+=Cts+" ";
			     }
			}
			$(".area_alredy span").html(area_list);
		});
		if ($.browser.msie && ($.browser.version == "6.0") && !$.support.style) {
			$('#main_box').width($('#main_box').width()-25);
		};
	});

	//基本信息、附件配置信息切换
	//附件配置信息
 	$("#attachConfig").click(function(){
 		$("#attachConfig").removeClass("alinks").addClass("alinkscurrent");
 		$("#basic").removeClass("alinkscurrent").addClass("alinks");
 		$("#otherInfo").removeClass("alinkscurrent").addClass("alinks");
 		
 		$("#at").css("display",'block');
 		$("#bs").css("display",'none');
 		$("#ot").css("display",'none');
 		
 		$("#upLogo").css("display","none");
 		$("#upBanner").css("display","none");
 		
 	})
 	// 基本信息
 	$("#basic").click(function(){
 		$("#basic").removeClass("alinks").addClass("alinkscurrent");
 		$("#attachConfig").removeClass("alinkscurrent").addClass("alinks");
 		$("#otherInfo").removeClass("alinkscurrent").addClass("alinks");
 		
 		$("#at").css("display",'none');
 		$("#bs").css("display",'block');
 		$("#ot").css("display",'none');
 		
 		$("#upLogo").css("display","block");
 		$("#upBanner").css("display","block");
 	})
 	//其他信息
 	$("#otherInfo").click(function(){
 		$("#otherInfo").removeClass("alinkscurrent").addClass("alinkscurrent");
 		$("#basic").removeClass("alinks").addClass("alinks");
 		$("#attachConfig").removeClass("alinkscurrent").addClass("alinks");
 		
 		$("#at").css("display",'none');
 		$("#bs").css("display",'none');
 		$("#ot").css("display",'block');
 		
 		$("#upLogo").css("display","none");
 		$("#upBanner").css("display","none");
 	})
 	
 	
 	/* if(siteid == null || siteid == ""){
 		document.getElementById("save_at_button").disabled = true;
 		document.getElementById("save_ot_button").disabled = true;
 	} */
	
	function checkEmail(){
		var adminEmail = $("#adminEmail").val();
		var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
		if(!reg.test(adminEmail)){
			$("#emailMsg").css("color","red");
			$("#emailMsg").html("邮箱格式不正确");
			document.getElementById("save_ot_button").disabled = true;
		} else{
			$("#emailMsg").html("");
			document.getElementById("save_ot_button").disabled = false;
		}
	}
</script>